import threading
import time  # 导入 time 模块

def print_greeting(name, greeting):
    while True:  # 使用一个无限循环
        print(f"{greeting}, {name}!")
        time.sleep(1)  # 暂停1秒

thread1 = threading.Thread(target=print_greeting,
                           name='process_load',
                           kwargs={"name": "Alice", "greeting": "Hello"})
thread1.start()

thread2 = threading.Thread(target=print_greeting,
                           name='process_load_2',
                           kwargs={"name": "Tom", "greeting": "Hello"})
thread2.start()
thread1.join()

# 等待第二个线程完成
thread2.join()
